 #include"Account.h"
#include<iostream>
using namespace std;
Account::Account(double b){
    balance=b;
    if(balance<0){
    cout<<" error "<<endl;
    balance=0;
    }
}
void Account::credit(double x){
    
    balance=x+balance;
}
bool Account::debit(double x){
    if(x>balance){
        cout<<" Debit amount exceeded account balance "<<endl;
        return false;}
    else{
        balance=balance-x;
        return true;
    } 
}
double Account::getBalance(){
    return balance;
}